package com.kuhyygy.service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class BinderService extends Service {

	private static final String TAG = "BinderService";

	public BinderService() {
		Log.i(TAG, "create instance");
	}

	private MyBinder myBinder = new MyBinder();

	public class MyBinder extends Binder {
		public BinderService getService() {
			return BinderService.this;
		}
	}

	@Override
	public IBinder onBind(Intent intent) {
		return myBinder;
	}

	@Override
	public void onDestroy() {
		Log.i(TAG, "destory bindService");
		super.onDestroy();
	}

	@Override
	public boolean onUnbind(Intent intent) {
		Log.i(TAG, "unbind bindService");
		return super.onUnbind(intent);
	}

	public void doMethod() {
		Log.i("BinderService", "my method...");
	}

}
